/*=========================================================================================
  File Name: moduleEcommerceMutations.js
  Description: Ecommerce Module Mutations
  ----------------------------------------------------------------------------------------
  Item Name: Vuesax Admin - VueJS Dashboard Admin Template
  Author: Pixinvent
  Author URL: http://www.themeforest.net/user/pixinvent
==========================================================================================*/



// 保存所有方法，用来改变state的数据
export default {
  // TOGGLE_ITEM_IN_WISH_LIST(state, item) {
  //     const index = state.wishList.findIndex(i => i.objectID == item.objectID)
  //     if (index < 0) {
  //         state.wishList.push(item)
  //     } else {
  //         state.wishList.splice(index, 1)
  //     }
  // },
  // UPDATE_ITEM_QUANTITY(state, payload) {
  //   state.cartItems[payload.index].quantity = payload.quantity
  // }

  // 基础信息
  // updateSiteDetailData(state, val) {
  //   state.siteDetailData = val;
  // },

  // 测值项
  UPDATE_SITE_GET_SITE(state,val) {
   state.getSiteItem=val;
  //  console.log(state.getSiteItem +"1")
  },
  
  UPDATE_ALARM_CONFIG_DATA(state, val) {
    state.alarmConfigData = val;
  },
  UPDATE_CURRENT_NODE(state, val) {
    state.currentNode = val;
  },
  UPDATE_TREE_DATA(state, val) {
    state.treeData = val;
  },
  UPDATE_EDIT_TREE_DATA(state, val) {
    state.editTreeData = val;
  },
  UPDATE_SITE_DETAIL_DATA(state, val) { //基础信息
    state.siteDetailData = val;
    // console.log(state.siteDetailData)    
  },
  UPDATE_FORMULAR_ID(state, val) {
    state.formularId = val;
  },
  UPDATE_SPITEM_FORM_VALID(state, val) {
    state.spItemFormValid = val;
  },
  UPDATE_ACTIVE_TAB_NAME(state, val) {
    state.activeTabName = val;
  },
  UPDATE_CURRENT_PAGE(state, val) {
    state.currentPage = val;
  },
  UPDATE_IS_SPITEM_SELECT(state, val) {
    state.isSpItemSelect = val;
  },
  UPDATE_IS_ADD_SPITEM(state, val) {
    state.isAddSpItem = val;
  },
  UPDATE_FORMULAR_DES(state, val) {
    state.formularDes = val;
  },
  UPDATE_SPITEM_SELECT(state, val) {
    state.spItemSelect = val;
  },
  UPDATE_FORMULAR_EDIT_DATA(state, val) {
    state.formularEditData = val;
  },
  UPDATE_EDIT_PARA_NAME(state, val) {
    state.editParaName = val;
  },
  UPDATE_IS_ASYNC_MODAL_SHOW(state, val) {
    state.isAsyncModalShow = val;
  }
};
